﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hfm.Common.Entity.Country;
using Hfm.Core.DataAccess;
using System.Data.SqlClient;

namespace Hfm.Core.DataAccess.Country
{
    public class CountryData
    {
         protected readonly CoreContext Context;

        public CountryData()
        {
            
        }

        public CountryData(CoreContext context)
        {
            Context = context;
        }

        public virtual List<CountryEntity> GetAllCountry()
        {
            var AllCountry = Context.CountryEntities.ToList();
            return AllCountry;
        }

        public virtual CountryEntity GetCountryById(int Id)
        {
            var Country = Context.CountryEntities.FirstOrDefault(p => p.CountryId == Id);
            return Country;
        }
    }
}
